from django.db import models


# Create your models here.
class Areas(models.Model):
    name = models.CharField(verbose_name='地区名称', max_length=20)
    parent = models.ForeignKey('self', verbose_name='上级行政区划', on_delete=models.SET_NULL, related_name='subs', null=True,
                               blank=True, )

    class Meta:
        db_table = 'tb_areas'
        verbose_name = '行政地区划分'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.name
